package com.test.eventbus;

import com.google.common.eventbus.EventBus;

import java.util.Date;

public class BizTask {

    private EventBus eventBus;

    public BizTask(EventBus eventBus) {
        this.eventBus = eventBus;
    }

    public void doTask() {
        System.out.println(String.format("BizTask.doTask => ThreadId = [%s]", Thread.currentThread().getId()));
        FirstEvent evt = new FirstEvent(new Date().getTime(), new Date().getTime() + "");
        eventBus.post(evt);
    }
}
